package com.example.com.skills_utf8;


import android.app.Application;

import com.app.AppException;
import com.app.G;
import com.app.util.Utils_Log;
import com.app.video.MyVideoCamera;
import com.app.voice.MyAudio;
import com.example.com.skills_utf8.baidu_map.MyLocation;
import com.jpush.jpush;
import com.lidroid.xutils.DbUtils;

import java.util.HashMap;
import java.util.Map;



public class ApplicationCustom extends Application {


    private static String TAG = ApplicationCustom.class.getSimpleName();
    public static ApplicationCustom mInstance;


    public MyLocation location = new MyLocation();
    public MyAudio audio = new MyAudio();
    public MyVideoCamera video = new MyVideoCamera();
    //public MyVideoCamera video2 = new MyVideoCamera();

    public DbUtils db;


    public static ApplicationCustom getInstance() {
        return mInstance;
    }

    @Override
    public void onCreate() {
        Utils_Log.i(TAG, "onCreate");
        super.onCreate();

        Thread.setDefaultUncaughtExceptionHandler( AppException.getAppExceptionHandler() );

        mInstance = this;

        init();// 初始化配置

    }

    public void init() {

        Map<String, Object> map = new HashMap<String, Object>();

        G.init(mInstance,map);
        initLoc();


        db = DbUtils.create(this);
        // 初始化极光推送
        jpush.OnCreate(getApplicationContext());


    }


    private void initAudio(){


    }

    private void initLoc() {

        location.OnCreate(this);

    }

}
